#include <BustaNetServer.h>
Public Member Functions | |
BustaNetServer () | |
Constructor. | |
~BustaNetServer () | |
Destructor. | |
char * | init (Uint16 servport) |
Initialize the server. | |
void | sendAccept (int to_client, bool response, char *message) |
Sends a connection response to a connecting client. | |
void | sendCharacterSelectedAllO (client *sel_client, BustaModelCharacter character) |
Sends a character selection notification to all connected clients. | |
void | sendCharacterSelectCursorAllO (client *sel_client, netPosition cursor) |
Sends a character selection cursor udpate to all connected clients. | |
void | sendCharacterSelectModeAll () |
Notifies all connected clients that multiplayer character selection is taking place. | |
void | sendConnectedAllO (client *sel_client) |
Notifies all connected clients another player has joined the game. | |
void | sendDisconnectedAllO (client *disc_client, char *message) |
Sends a disconnect notification to all connected clients. | |
void | sendEndAll () |
Sends an end game message to all players. | |
void | sendPlayerLostAllO (client *lost_player) |
Sends a notification to all client when one client has lost in the current game. | |
void | sendPlayerReadyAllO (client *ready_player) |
Sends a notification to all client when a player has selected ready. | |
void | sendSandwichAllO (client *target_client, client *from_client, SpecialSandwich sandwich) |
Sends a notification to all client opponents that a special sandwich has been sent to a player. | |
void | sendGameStartAll () |
Notifies all connected clients to start the multiplayer game. | |
void | sendUpdateAll () |
Sends client game state information to all connected clients. | |
void | setDebug (bool OnOff) |
Sets the server in debug mode. | |
void | setExtrememDebug (bool OnOff) |
Sets the server in extreme debug mode. | |
void | setMaxClients (int maxC) |
Sets the maximum number of allowed connections. | |
int | getMaxClients () |
Gets the maximum number of allowed connections. | |
void | setName (char *servname) |
Sets the name of the server. | |
char * | getName () |
Gets the name of the server. | |
int | setStateAutoAccept (int num_clients) |
Auto accepts clients and adds them to the socket set. | |
int | setStateAccept () |
Sets the server in client connection accepting mode. | |
int | setStateCharSelect () |
Sets the server in client character selection mode. | |
int | setStateGame () |
Sets the server in game mode. |
Standalone server class for hosting and handling multiplayer games of Busta'Sandwich..
|
Constructor.
|
|
Destructor.
|
|
Gets the maximum number of allowed connections. Returns the maximum number of simultaneous connections allowed by clients at any given time. |
|
Gets the name of the server. Returns the server identification name. |
|
Initialize the server. Initializes SDL and SDLNet. A socket to connect to the server is created for the server's ip address on the specified port.
|
|
Sends a connection response to a connecting client. Responds to a client's connection attempt. The client is sent a message detailing whether or not the connection was allowed, a message describing why or why not the connection was allowed, and the player's identification number if the connection was accepted.
|
|
Sends a character selection cursor udpate to all connected clients. Sends an update message to all clients except the selected client that the player has moved the cursor and the location.
|
|
Sends a character selection notification to all connected clients. Sends a notification message to all clients except the selected client that the player has selected a character and what it is.
|
|
Notifies all connected clients that multiplayer character selection is taking place. A message is sent to all clients connected to the server that all clients are to now select a multiplayer character. |
|
Notifies all connected clients another player has joined the game. A message that notifies all of the other clients that a player has connected. Used in the connection screen for example. |
|
Sends a disconnect notification to all connected clients. Sends a notification message to all clients that are still connected when a client disconnects from the server. Includes details as to why client disconnected.
|
|
Sends an end game message to all players. Needs some commenting... |
|
Notifies all connected clients to start the multiplayer game. A message is sent to all connected clients that the multiplayer game is now starting. |
|
Sends a notification to all client when one client has lost in the current game. A notification that a client has lost in the current multiplayer game is sent to all other connected clients. The player who has lost is not notified.
|
|
Sends a notification to all client when a player has selected ready. A notification that a client has selected ready in the connection screen
|
|
Sends a notification to all client opponents that a special sandwich has been sent to a player. A notification that a client has sent a special sandwich to another opponent
|
|
Sends client game state information to all connected clients. Sends game state information to all connected clients. This includes the brief information required by each player as well as the detailed game state requested by each client. |
|
Sets the server in debug mode. Turns on debugging output to the console for the server.
|
|
Sets the server in extreme debug mode. Turns on extreme debugging output to the console for the server.
|
|
Sets the maximum number of allowed connections. Specifies the maximum number of simultaneous connections allowed by clients at any given time.
|
|
Sets the name of the server. Assigns the server an identification name.
|
|
Sets the server in client connection accepting mode. The server is now in a state to accept incoming TCP connections from clients. The server may leave this mode when all connected clients have sent a ready notification to the server and there is at least two connected clients.
|
|
Auto accepts clients and adds them to the socket set. The server automatically accepts clients and adds them to the socket set. Used only for testing other functionality. Does not send any of the notification messages of a standard accept loop.
|
|
Sets the server in client character selection mode. The server is now in a state that allows clients to select a multiplayer character. The server leaves this mode when all connected clients have sent a selected character to the server. The server may also leave this mode if client disconnects occur leaving less than two connected clients.
|
|
Sets the server in game mode. The server is now in multiplayer game mode. All clients are currently playing the game. The server leaves this mode when all but one player has lost in the game or less than two clients remain connected to the server while in this mode.
|